﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace weighing
{
    public class Int2ReVisisibiltyConverter : System.Windows.Data.IValueConverter
    {
            public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
            {
                var res = (int)value == 0 ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
                return res;
            }

            public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
            {
                var res = (System.Windows.Visibility)value == System.Windows.Visibility.Visible ? 0 : 1;
                return res;
            }
        }
    }

